package com.example.demo.mapper;

import com.example.demo.bean.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

/**
 * 用户数据访问接口
 */
@Mapper
public interface UserMapper {
    User findById(@Param("id") Integer id);
    List<User> findAll();
    int insert(User user);
    int update(User user);
    int deleteById(@Param("id") Integer id);
    User findByUsername(@Param("uname") String uname);
    List<User> findByClass(@Param("className") String className);
    List<User> findByPage(@Param("offset") int offset, 
                         @Param("pageSize") int pageSize, 
                         @Param("search") String search);
    
    Long countTotal(@Param("search") String search);
}